package practice;

import java.util.*;

public class Day31 {
    //小红的字符串
    private static int n;
    private static char[] arr;
    //种类在[1,x]内的子串个数
    private static long fun(int x) {
        int left = 0;
        int right = 0;
        int kind = 0;
        int[] dp = new int[27];
        long ret = 0;
        while(right < n) {
            dp[arr[right]-'a']++;
            if(dp[arr[right]-'a'] == 1) {
                kind++;
            }
            while(kind > x) {
                dp[arr[left]-'a']--;
                if(dp[arr[left]-'a'] == 0) {
                    kind--;
                }
                left++;
            }
            ret += (right - left + 1);
            right++;
        }
        return ret;
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        int l = in.nextInt();
        int r = in.nextInt();
        arr = in.next().toCharArray();

        System.out.println(fun(r) - fun(l-1));

    }

    //有效的括号
    public boolean isValid(String s) {
        Stack<Character> stack = new Stack<>();
        int len = s.length();
        int i = 0;
        while (i < len) {
            if (stack.isEmpty()) {
                stack.push(s.charAt(i));
            } else {
                char ch = stack.peek();
                char c1 = s.charAt(i);
                if (ch == '(' && c1 == ')' || ch == '[' && c1 == ']' || ch == '{' && c1 == '}') {
                    stack.pop();
                } else {
                    stack.push(c1);
                }
            }
            i++;
        }
        return stack.isEmpty();
    }

    //二叉树的右视图
    private List<Integer> ret;

    public List<Integer> rightSideView(TreeNode root) {
        ret = new ArrayList<>();
        if(root == null) {
            return ret;
        }
        rightSideViewChild(root);
        return ret;
    }

    private void rightSideViewChild(TreeNode node) {
        Queue<TreeNode> stack = new LinkedList<>();
        stack.offer(node);
        while (!stack.isEmpty()) {
            int len = stack.size();
            List<Integer> list = new ArrayList<>();
            while (len != 0) {
                TreeNode top = stack.poll();
                if (top.left != null) {
                    stack.offer(top.left);
                }
                if (top.right != null) {
                    stack.offer(top.right);
                }
                list.add(top.val);
                len--;
            }
            ret.add(list.get(list.size() - 1));
        }
    }

    public void flatten(TreeNode root) {
        TreeNode cur = root;
        while(cur != null) {
            if(cur.left != null) {
                TreeNode pre = cur.left;
                TreeNode next = pre;
                while(next.right != null) {
                    next = next.right;
                }
                next.right = cur.right;
                cur.right = pre;
                cur.left = null;
            }
            cur = cur.right;
        }
    }

}
